export default {
  // inject: ['getGlobalDsv', "designer"],
  // inject: ["$designer"],
  data() {
    return {
      field: {},
      // options: {}
    }
  },
  computed: {
    fieldLib() {
      return this.designer.fieldLib;
    },
    customClass() {
      return this.options.customClass || "";
    },
  },
  created() {
    this.field = this.designer.fieldLib[this.fieldId]
  },
  mounted() {
    if (this.designer.designStatus) {
      this.designer.handleEvent(`fieldOptionChange_${this.fieldId}`, (newValue) => {
        // console.log(`fieldOptionChange_${this.fieldId}`, newValue)
        this.field = newValue
      });
    }
  },
  methods: {
    selectField(field) {
      if (this.designer.designStatus) {
        this.designer.setSelected(field);
      }
    },
  }
}
